package com.example.demo.impl;

import com.example.demo.MyBean;
import com.example.demo.properties.ConstructInjection;
import com.example.demo.properties.SetInjection;

public class InjectionBean implements MyBean {
    private SetInjection setInjection;
    private ConstructInjection constructInjection;

    public InjectionBean(){}

    public InjectionBean(ConstructInjection constructInjection){
        this.constructInjection=constructInjection;
    }

    public void setSetInjection(SetInjection setInjection) {
        this.setInjection = setInjection;
    }

    @Override
    public void hello() {
        if(setInjection != null)
            setInjection.InjectHello();
        else if(constructInjection != null)
            constructInjection.ConstructHello();
    }


}
